package com.tanhua.server.interceptor;

import com.tanhua.model.db.User;

/**
 * @auther : 白月尘
 * @date : 13:16  2021/10/17
 */
public class UserHolder {
    private static ThreadLocal<User> threadLocal=new ThreadLocal<User>();

    public static void set(User user) {
        threadLocal.set(user);
    }

    public static long getUserId() {
        return threadLocal.get().getId();
    }

    public static String getMobile() {
        return threadLocal.get().getMobile();
    }

    public static void remove() {
        threadLocal.remove();
    }
}
